import {RouteRecordRaw} from "vue-router";
import HomeIndex from "@/layout/default.vue"
import {PagePath} from "@/util/commonUtil";

export const homeRouters: Array<RouteRecordRaw> = [{
    path: '/',
    component: HomeIndex,
    redirect: '/',
    name: '_home',
    meta: {
        title: '首页'
    },
    children: [
        {
            path: '/',
            name: 'Home',
            meta: {title: import.meta.env.VITE_APP_TITLE},
            component: () => import('@/views/home/index.vue')
        },
        {
            path: PagePath.Vip,
            name: 'Vip',
            meta: {title: '会员中心'},
            component: () => import('@/views/vip/index.vue')
        },
        {
            path: PagePath.About,
            name: 'About',
            meta: {title: '关于我'},
            component: () => import('@/views/about/index.vue')
        },
        // 结果页
        {
            path: PagePath.ResultsPath,
            name: 'Results',
            meta: {title: '搜索结果'},
            component: () => import('@/views/results/index.vue')
        },
        {
            path: PagePath.UserCenterPath,
            name: 'UserCenter',
            meta: {title: '用户中心'},
            component: () => import('@/views/userCenter/index.vue')
        },
        {
            path: PagePath.PostInfoPath + ':blogOid',
            component: () => import('@/views/post/index.vue')
        },
        {
            path: PagePath.MedalPath + ':userUid',
            name: 'Medal',
            meta: {title: '徽章'},
            component: () => import('@/views/medal/index.vue')
        },
        {
            path: PagePath.SignPath,
            name: 'Sign',
            meta: {title: '签到'},
            component: () => import('@/views/sign/index.vue')
        },
        {
            path: PagePath.MessageBoardPath,
            name: 'MessageBoard',
            meta: {title: '众言'},
            component: () => import('@/views/messageBoard/index.vue')
        },
        {
            path: PagePath.SortPath,
            name: 'Sort',
            meta: {title: '文章归档'},
            component: () => import('@/views/sort/index.vue')
        },
        {
            path: PagePath.FriendsPath,
            name: 'Friends',
            meta: {title: '众星'},
            component: () => import('@/views/friends/index.vue')
        },
        {
            path: PagePath.Hot,
            name: 'Hot',
            meta: {title: '热搜'},
            component: () => import('@/views/hot/index.vue')
        },
        {
            path: PagePath.Question,
            name: 'Question',
            meta: {title: '问答'},
            component: () => import('@/views/question/index.vue')
        },
        {
            path: PagePath.Moment,
            name: 'Moment',
            meta: {title: '瞬间'},
            component: () => import('@/views/moment/index.vue')
        },
        {
            path: PagePath.Mall,
            name: 'Mall',
            meta: {title: '小店'},
            component: () => import('@/views/mall/index.vue')
        },
        {
            path: PagePath.Subject,
            name: 'Subject',
            meta: {title: '专题'},
            component: () => import('@/views/subject/index.vue')
        },
        {
            path: PagePath.Rank,
            name: 'Rank',
            meta: {title: '排行榜'},
            component: () => import('@/views/rank/index.vue')
        },
        {
            path: PagePath.Code,
            name: 'Code',
            meta: {title: '面经'},
            component: () => import('@/views/code/index.vue')
        },
        {
            path: PagePath.Notice,
            name: 'Notice',
            meta: {title: '通知'},
            component: () => import('@/views/notice/index.vue')
        },
        {
            path: PagePath.Sponsor,
            name: 'Sponsor',
            meta: {title: '赞助'},
            component: () => import('@/views/sponsor/index.vue')
        },
        {
            path: PagePath.Lucky,
            name: 'Lucky',
            meta: {title: '抽奖'},
            component: () => import('@/views/lucky/index.vue')
        },
    ]
}]
